<template>
  <yy-paging v-model="dataList" @query="queryList" ref="paging" :auto="automatic" @scroll="scroll" :refresher-enabled="false">
    <template #top>
      <u-navbar
        back-text=""
        :is-back="true"
        :title="type == 1 ? '用户协议' : '隐私政策'"
        :background="{ backgroundColor: isScroll ? '#FFFFFF' : 'transparent' }"
        :border-bottom="false"
        :custom-style="{ transition: 'background-color 0.3s ease-in-out' }"
      >
      </u-navbar>
    </template>
    <view class="p-4">
      <view v-for="(i, k) in 60" :key="k"> {{ type == 1 ? '用户协议' : '隐私政策' }} </view>
    </view>
  </yy-paging>
</template>

<script>
  export default {
    data() {
      return {
        isScroll: false,
        dataList: [],
        automatic: false,
        type: ''
      }
    },
    onLoad(options) {
      this.type = options.type
      this.getDetails()
    },
    methods: {
      scroll(e) {
        this.isScroll = e.detail.scrollTop > 0
      },
      async queryList(page, limit) {
        this.$refs.paging.complete([1, 1, 1])
      },
      getDetails() {
        let obj = {}
        let res = api.getArticleDetail(obj)
        vk.toast(res.msg, 'none')
        if (!res.code) return
      }
    }
  }
</script>

<style lang="scss" scoped></style>
